package com.heking.securityapp.entiry;

import android.os.Parcel;

/**
 * @Author 35574
 * @Date 2021/10/25
 * @Description
 */
public class ParcelableB extends ParcelableParent {
    private int gender;

    public ParcelableB( ) {
    }

    public ParcelableB(String name, int gender) {
        super(name);
        this.gender = gender;
    }

    public ParcelableB(Parcel in) {
        super(in);
        gender = in.readInt();
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        super.writeToParcel(dest,flags);
        dest.writeInt(gender);
    }

    public static final Creator<ParcelableB> CREATOR = new Creator<ParcelableB>() {
        @Override
        public ParcelableB createFromParcel(Parcel in) {
            return new ParcelableB(in);
        }

        @Override
        public ParcelableB[] newArray(int size) {
            return new ParcelableB[size];
        }
    };

    public int getGender() {
        return gender;
    }

    public void setGender(int gender) {
        this.gender = gender;
    }

    @Override
    public String toString() {
        return "ParcelableB{" +
                "name=" + getName() +","+
                "gender=" + getGender() +
                '}';
    }

}
